Skip to content

feat(services/http): support if_modified_since and if_unmodified_since#7636

Merged
erickguan merged 2 commits into
apache:mainfrom
YuangGao:feat/http-conditional-read
Jun 28, 2026
Merged

feat(services/http): support if_modified_since and if_unmodified_since#7636
erickguan merged 2 commits into
apache:mainfrom
YuangGao:feat/http-conditional-read

Conversation

@YuangGao

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #5486.

Rationale for this change

The http service already wires if_match / if_none_match on read and stat. RFC 7232 defines If-Modified-Since / If-Unmodified-Since as the date-based counterparts, and they're standard on every HTTP/1.1 server

What changes are included in this PR?

  • Inject If-Modified-Since / If-Unmodified-Since in http_get_request and http_head_request.
  • Declare read_with_if_modified_since, read_with_if_unmodified_since, stat_with_if_modified_since, stat_with_if_unmodified_since on the http service capability.

Are there any user-facing changes?

Yes — op.reader_with(path).if_modified_since(...) / if_unmodified_since(...) (and the stat equivalents) now work against http backends. No breaking changes.

AI Usage Statement

AI-assisted implementation.

@YuangGao YuangGao marked this pull request as ready for review May 29, 2026 05:19
@YuangGao YuangGao requested a review from Xuanwo as a code owner May 29, 2026 05:19
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels May 29, 2026
@YuangGao YuangGao force-pushed the feat/http-conditional-read branch from 570288e to 324ccaa Compare May 29, 2026 05:34
@YuangGao YuangGao requested review from Zheaoli and messense as code owners May 29, 2026 05:34
@YuangGao

YuangGao commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

@Xuanwo This is ready for review. The failing checks are unrelated flaky tests. Could you help re-run them? Thanks!

Inject If-Modified-Since and If-Unmodified-Since in http_get_request
and http_head_request, and declare the matching read/stat capabilities.

Part of apache#5486.
@YuangGao YuangGao force-pushed the feat/http-conditional-read branch from 2aeec52 to 8c083c3 Compare June 23, 2026 01:03


@pytest.mark.need_capability(
"read", "read_with_if_modified_since", "read_with_if_unmodified_since"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, what does this change for python binding?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this change, enabling read_with_if_modified_since / read_with_if_unmodified_since on the HTTP service makes test_sync_conditional_reads newly match the HTTP backend via need_capability, then crash on operator.write() since HTTP is read-only. Adding write / delete to the gate aligns it with what the test body actually does and keeps the test skipped on read-only backends

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. We can skip delete here. And we probably don't need to clean up explicitly.

@erickguan erickguan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for working on this!

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 28, 2026
@erickguan erickguan merged commit e489f0b into apache:main Jun 28, 2026
189 of 190 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants